package com.bjsxt.controller;

import com.bjsxt.pojo.Host;
import com.bjsxt.pojo.PageA;
import com.bjsxt.service.HostService;
import org.apache.ibatis.annotations.Insert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/host")
public class HostController {

    @Autowired
    private HostService hostService;

    @RequestMapping("/selectHost")
    public PageA<Host> selectHost(Integer page, Integer rows,Host host){


        return hostService.selectHostSice(page, rows,host);
    }


    @RequestMapping("/updateHost")
    public Integer updateHost(Integer strong,Integer hid){
        return hostService.updateHostSice(strong, hid);
    }


    @RequestMapping("/inseteHost")
    public Integer inseteHost(Host host){
        return hostService.insetHostSice(host);
    }


    //修改status
    @RequestMapping("/updateStatus")
    public Integer updateStatus(Integer hid,String status){
        return hostService.updateHostStatusSice(hid,status);
    }
}
